﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ipoverview.aspx.cs" Inherits="Com.Rivyer.Web.ip.ipoverview" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>IP管理</title>
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../css/rivcontent.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <%if (DesignMode)
      { %>
    <script type="text/javascript" src="../js/ASPxScriptIntelliSense.js"></script>
    <%} %>
    <script type="text/javascript">
        
    </script>
    <div>
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td height="30">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td height="24" bgcolor="#353c44">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td>
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td width="6%" height="19" valign="bottom">
                                                        <div align="center">
                                                            <img src="../images/tb.gif" width="14" height="14" /></div>
                                                    </td>
                                                    <td width="94%" valign="bottom">
                                                        <span class="STYLE1">IP管理</span>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="center" style="font-size: 12px; width=100%">
                    <div id="rivcontent">
                        <div class="title">
                            IP地址管理
                        </div>
                        <dx:ASPxGridView ID="ipoverviewgrid" runat="server" Font-Size="12px" AutoGenerateColumns="False"
                            DataSourceID="SqlDataSource1" KeyFieldName="id" Width="865px" ClientInstanceName="ipgridclient"
                            OnRowDeleting="ipoverviewgrid_RowDeleting" OnRowUpdating="ipoverviewgrid_RowUpdating">
                            <Columns>
                                <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" Width="80px">
                                    <EditButton Text="修改" Visible="True">
                                    </EditButton>
                                    <DeleteButton Text="清除" Visible="True">
                                    </DeleteButton>
                                </dx:GridViewCommandColumn>
                                <dx:GridViewDataTextColumn FieldName="id" ReadOnly="True" Visible="False" VisibleIndex="1">
                                    <EditFormSettings Visible="False" />
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="ip" VisibleIndex="2" Width="95px" ReadOnly="True">
                                    <EditFormSettings Visible="False" />
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="责任人" FieldName="usedperson" VisibleIndex="4"
                                    Width="90px">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="部门" FieldName="department" VisibleIndex="6" Width="110px">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="单位" FieldName="organization" VisibleIndex="5"
                                    Width="90px">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataCheckColumn Caption="外网" FieldName="usedinternet" VisibleIndex="7"
                                    Width="35px">
                                    <Settings AllowHeaderFilter="False" ShowFilterRowMenu="False" />
                                </dx:GridViewDataCheckColumn>
                                <dx:GridViewDataMemoColumn Caption="备注" FieldName="description" VisibleIndex="8"
                                    Width="120px">
                                </dx:GridViewDataMemoColumn>
                                <dx:GridViewDataTextColumn Caption="MAC" FieldName="macaddress" VisibleIndex="3"
                                    Width="100px">
                                    <PropertiesTextEdit NullText="MAC地址格式:**-**-**-**-**-**">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataDateColumn Caption="生产日期" FieldName="productdate" VisibleIndex="9"
                                    Width="65px">
                                    <PropertiesDateEdit DisplayFormatString="yyyy/MM">
                                    </PropertiesDateEdit>
                                </dx:GridViewDataDateColumn>
                                <dx:GridViewDataDateColumn Caption="修改日期" FieldName="modifydate" VisibleIndex="10"
                                    Width="80px">
                                    <PropertiesDateEdit DisplayFormatString="MM/dd hh:mm">
                                    </PropertiesDateEdit>
                                    <EditFormSettings Visible="False" />
                                </dx:GridViewDataDateColumn>
                            </Columns>
                            <SettingsBehavior ConfirmDelete="True" />
                            <SettingsPager PageSize="13">
                            </SettingsPager>
                            <Settings ShowFilterRow="True" ShowFilterRowMenu="True" ShowGroupPanel="True" />
                            <Styles>
                                <Header HorizontalAlign="Center">
                                </Header>
                            </Styles>
                        </dx:ASPxGridView>
                        <span class="tips">Tips:</span>1.责任人必填;2.部门、单位可以选填一项;3.备注、MAC、生产日期选填;<br />
                        4.ping和mac工具调用较慢,一次不要选中过多数据
                        <div class="editzone">
                            <table border="0" cellpadding="5px" cellspacing="0">
                                <tr>
                                    <td>
                                        <dx:ASPxButton ID="checkAll" runat="server" Text="全选" AutoPostBack="False">
                                            <ClientSideEvents Click="function(s, e) {
	ipgridclient.SelectAllRowsOnPage();
}" />
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <dx:ASPxButton ID="uncheckAll" runat="server" Text="不选" AutoPostBack="False">
                                            <ClientSideEvents Click="function(s, e) {
	ipgridclient.UnselectAllRowsOnPage();
}" />
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <dx:ASPxButton ID="pingbtn" runat="server" Text="Ping" OnClick="pingbtn_Click">
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <dx:ASPxButton ID="macbtn" runat="server" Text="MAC" OnClick="macbtn_Click">
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <dx:ASPxButton ID="editBatch" runat="server" Text="批量分配" OnClick="editBatch_Click">
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <dx:ASPxButton ID="deleteBatch" runat="server" Text="批量收回" OnClick="deleteBatch_Click">
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <asp:FileUpload ID="FileUpload1" runat="server" BorderStyle="Solid" 
                                            BorderWidth="1px" />
                                    </td>
                                    <td>
                                        <dx:ASPxButton ID="ASPxButton1" runat="server" Text="批量导入" 
                                            onclick="ASPxButton1_Click">
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <a href="./upload/ip批量增加修改模版.xls" style="font-size:12px">批量增加修改模版下载</a>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString='<%$ ConnectionStrings:ITConnectionString %>'
        DeleteCommand="DELETE FROM [tb_ipaddress] WHERE [id] = @id" InsertCommand="INSERT INTO [tb_ipaddress] ([ip], [usedperson], [department], [organization], [usedinternet], [description], [macaddress], [productdate], [modifydate]) VALUES (@ip, @usedperson, @department, @organization, @usedinternet, @description, @macaddress, @productdate, @modifydate)"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [tb_ipaddress] ORDER BY [id]"
        UpdateCommand="UPDATE [tb_ipaddress] SET [ip] = @ip, [usedperson] = @usedperson, [department] = @department, [organization] = @organization, [usedinternet] = @usedinternet, [description] = @description, [macaddress] = @macaddress, [productdate] = @productdate, [modifydate] = @modifydate WHERE [id] = @id">
        <DeleteParameters>
            <asp:Parameter Name="id" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="ip" Type="String" />
            <asp:Parameter Name="usedperson" Type="String" />
            <asp:Parameter Name="department" Type="String" />
            <asp:Parameter Name="organization" Type="String" />
            <asp:Parameter Name="usedinternet" Type="Int32" />
            <asp:Parameter Name="description" Type="String" />
            <asp:Parameter Name="macaddress" Type="String" />
            <asp:Parameter DbType="Date" Name="productdate" />
            <asp:Parameter Name="modifydate" Type="DateTime" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="ip" Type="String" />
            <asp:Parameter Name="usedperson" Type="String" />
            <asp:Parameter Name="department" Type="String" />
            <asp:Parameter Name="organization" Type="String" />
            <asp:Parameter Name="usedinternet" Type="Int32" />
            <asp:Parameter Name="description" Type="String" />
            <asp:Parameter Name="macaddress" Type="String" />
            <asp:Parameter DbType="Date" Name="productdate" />
            <asp:Parameter Name="modifydate" Type="DateTime" />
            <asp:Parameter Name="id" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </form>
</body>
</html>
